﻿using Abp.Application.Services;
using FwProject.Com.Dto;
using FwProject.Comm;
using FwProject.ShopApplication;
using FwProject.ShoppingMall.Com;
using FwProject.ShoppingMall.EventAdvertising;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using X.PagedList;

namespace FwProject.Com.Dto
{
    /// <summary>
    /// 创建一个订单
    /// </summary>
    public interface IShopOrderAppService : IApplicationService
    {
        #region 创建一个订单
        /// <summary>
        /// 创建一个订单
        /// </summary>
        /// <param name="Input">订单模型</param>
        /// <returns></returns>
        Task<string> CreateShopOrder(ShopOrderInput Input);
        #endregion
        #region 确认订单
        [HttpPost]
        Task<EnterOrderModel> EnterOrder(OrderModelInput model);
        [HttpPost]
        Task<EnterOrderModel> EnterCarOrder(GuidModel carId);
        #endregion
        /// <summary>
        /// 发起支付
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        [HttpGet]
        Task<string> GetPayDoing(Guid Id);
        /// <summary>
        /// 获取定点详情明细
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<ShopOrderDetailsOutputDto>> GetOrderDetailsByOrderId(Guid id);
        /// <summary>
        /// 更改支付方式
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="payType"></param>
        /// <returns></returns>
        Task<string> ModifyPayType(Guid Id, PayType payType);
        /// <summary>
        /// 订单状态列表信息
        /// </summary>
        /// <param name="page">页数</param>
        /// <param name="pagesize">条数</param>
        /// <param name="payStatus">支付状态</param>
        /// <param name="DeliveryStatus">发货状态</param>
        /// <param name="EvaluateStatus">评论状态</param>
        /// <returns></returns>
        Task<IPagedList<ShopOrderAppDto>> GetOrderStatus(int page, int pagesize, PayStatus? payStatus, DeliveryStatus? DeliveryStatus, EvaluateStatus? EvaluateStatus, string keywords = "");
        /// <summary>
        /// 获取未评价的订单信息
        /// </summary>
        /// <param name="page">页数</param>
        /// <param name="pagesize">条数</param>
        /// <returns></returns>
        Task<IPagedList<ShopOrderAppDto>> GetOrderEvaluateStatus(int page, int pagesize,string keywords="");


        /// <summary>
        /// App-订单收货
        /// </summary>
        /// <param name="id">订单Id</param>
        /// <returns></returns>
        Task OrderReceiptAppAsync(Guid id);

        /// <summary>
        /// App-订单删除
        /// </summary>
        /// <param name="id">订单Id</param>
        /// <returns></returns>
        Task OrderDeteleAsync(Guid id);

        #region 后台管理
        /// <summary>
        /// 后台管理-订单列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        Task<LayerDataBaseDto> GetShopOrderLayerDataAsync(int page, int limit, ShopOrderFilter filter);
        /// <summary>
        /// 获取前5条代发货订单
        /// </summary>
        /// <returns></returns>
       Task<LayerDataBaseDto> GetStayOrders();

        /// <summary>
        /// 后台管理-根据id获取订单处理信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ShopOrderHandleDto> GetShopOrderHandleDtoByOrderId(Guid id);

        Task<ShopOrderHandleDto> GetShopOrderHandleDtoByOrderNumber(string orderNumber);

        /// <summary>
        /// 后台管理-根据订单Id获取相应状态的订单明细
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<LayerDataBaseDto> GetOrderDetailsByOrderIdAsync(Guid id, ShopOrderStatus status);

        /// <summary>
        /// 后台管理-订单发货
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task OrderShipAsync(List<Guid> ids);

        /// <summary>
        /// 后台管理-订单收货
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task OrderReceiptAsync(List<Guid> ids);

        /// <summary>
        /// 后台管理-申请售后
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task OrderAfterSaleAsync(List<Guid> ids);

        /// <summary>
        /// 后台管理-取消订单
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        Task OrderCancelAsync(Guid id);

        /// <summary>
        /// 后台管理-获取导出订单
        /// </summary>
        /// <returns></returns>
        Task<List<ShopOrderExportDto>> GetExportDataAsync(ShopOrderStatus? status, string keyword);
        #endregion


    }
}
